package io;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;

import com.wxg.thinkinginjava.file.FileUtils;

public class FormattedMemoryInputMY {
	public static void main(String[] args) throws IOException {
		DataInputStream in = null;
		try {
			String path = FileUtils.getJavaFilePath(FormattedMemoryInputMY.class);
			in = new DataInputStream(new ByteArrayInputStream(
					BufferedInputFile.read( path + "FormattedMemoryInput.java")
							.getBytes()));
			while (true)
				System.out.print((char) in.readByte());
		} catch (EOFException e) {
			System.err.println("End of stream");
		} finally {
			if ( null != in ) {
				in.close();
			}
		}
	}
}
